package com.itheima.job7;

import java.io.*;

public class Test {
    public static void main(String[] args) throws IOException {
        File file = new File("E:/test/part");
        File[] files = file.listFiles();
        byte[] buffer = new byte[1024];

        FileOutputStream fileOutputStream = new FileOutputStream("E:/test/002.mp4");
        for (int i = 0; i < files.length; i++) {
            int len = -1;
            System.out.println(files[i].getName());
            FileInputStream fis = new FileInputStream(files[i]);
            while((len=fis.read(buffer))!=-1){
                fileOutputStream.write(buffer,0,len);
            }
            fis.close();
        }
        fileOutputStream.close();

    }
}
